/**
 * Created by jy on 2014/8/1.
 */
var _ = require('underscore');
var Q = require('q');
var http = require("http");

var sendAuto = function(req, res, result) {
  if (!_.isEmpty(req.query.callback)) {
    res.jsonp(result);
  } else {
    res.send(result);
  }
};
exports.sendAuto = sendAuto;

var getRequest = function (url) {
  var deferred = Q.defer();
  http.get(url,function(res){

  }).on("error",function(err){
    deferred.reject(err);
  });
  return deferred.promise;
};
